
package com.example.moshudriver.protocol;

import com.external.activeandroid.DataBaseModel;
import com.external.activeandroid.annotation.Column;
import com.external.activeandroid.annotation.Table;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
//������Ϣ
@Table(name = "LOCATION_CHARGE")
public class LOCATION_CHARGE  extends DataBaseModel
{


   

     @Column(name = "isopen")
     public int isopen;

     @Column(name = "start_price")
     public Float start_price;
     
     @Column(name = "per_distant")
     public Float per_distant;
     @Column(name = "start_distant")
     public Float start_distant;
     @Column(name = "region_name")
     public String   region_name;
     @Column(name = "lowest")
     public String   lowest;
     
     
     @Column(name = "push_number")
     public int push_number;

    
     public void  fromJson(JSONObject jsonObject)  throws JSONException
     {
          if(null == jsonObject){
            return ;
           }

          this.lowest=jsonObject.optString("lowest");
          this.region_name=jsonObject.optString("region_name");
          this.start_price=(float)jsonObject.optDouble("start_price");
          this.per_distant=(float)jsonObject.optDouble("per_distant");
          this.start_distant=(float)jsonObject.optDouble("start_distant");
          this.isopen = jsonObject.optInt("isopen");

          
          return ;
     }

     public JSONObject  toJson() throws JSONException 
     {
          JSONObject localItemObject = new JSONObject();
          JSONArray itemJSONArray = new JSONArray();
          localItemObject.put("lowest", lowest);
          localItemObject.put("region_name", region_name);
          localItemObject.put("start_price", start_price);
          localItemObject.put("per_distant", per_distant);
          localItemObject.put("start_distant", start_distant);
          localItemObject.put("isopen", isopen);
         
          return localItemObject;
     }

}
